import router from "../../../apis/routers";

const key = getFilePathStore(import.meta.url)

export const useResultStore = defineStore(key, {
    state: () => ({
        coreBaseNavightionStore: useCoreBaseNavightionStore(),
        headerTitle: "恭喜您，终于测评完了",
        messageTitle: "对于本次测评，我们专门制作了九型人格测评报告，包括:优势人格深度解剖、九型人格测评分析、职业规划建议、人格剖面完全解析等详细内容。我们有两种方式解锁本报告。",    
        dividerTitle:'测评结果如下',
        ResTable1Value:[
            {title:'九型人格',value:'A'},
            {title:'优势人格',value:'A'},
            {title:'弱势人格',value:'A'},
            {title:'平衡人格',value:'A'},
            {title:'自我发现',value:'A'},
            {title:'自我成长',value:'A'},
            {title:'自我保护',value:'A'},
            {title:'自我发展',value:'A'},
            {title:'自我实现',value:'A'},
        ]
    }),
    actions: {
        async initStore() {
            this.coreBaseNavightionStore.initStore().then(async (res) => {
                await res.setTitle('查看报告');
                await res.setHaveLeftIcon(false);
                await res.setHaveRightIcon(false);
            });
        },
        async getOutcomeEngramExhibition(){
            router.push({name:'testReport'});
        },
        async getRetestEngramExhibition(){
            router.push({name:'testStart'});
        }
    },
    persist: {
        key: key,
        storage: sessionStorage
    }
})